<div class="pt-2" ...attributes>
    <label class="block {{@className}}">{{@key}}{{#if @required}}<span class="text-red-500">*</span>{{/if}}</label>
    {{#if @multiLine}}
    <textarea placeholder="请填写{{@key}}" value={{@value}} name="{{@name}}" form="{{@form}}" {{on "blur" this.checkRequired}} class="block mt-2 w-full placeholder-gray-400/70 dark:placeholder-gray-500 rounded-lg border bg-white px-4 h-32 py-2.5 text-gray-700 focus:outline-none focus:ring focus:ring-opacity-40 dark:bg-gray-900 dark:text-gray-300 {{if this.err "border-red-400 focus:border-red-400 focus:ring-red-300 dark:border-red-400 dark:focus:border-red-300" "border-gray-200 focus:border-blue-400 focus:ring-blue-300 dark:border-gray-600 dark:focus:border-blue-300"}} {{if @readonly "bg-gray-50 text-gray-600 border-gray-300"}}" readonly={{@readonly}}></textarea>
    {{else}}
    <input type="{{if @type @type 'text'}}" value={{@value}} placeholder="请填写{{@key}}" name="{{@name}}" form="{{@form}}" min={{@min}} step={{@step}} {{on "blur" this.checkRequired}} class="block disabled:bg-gray-50 disabled:cursor-not-allowed mt-2 w-full placeholder-gray-400/70 dark:placeholder-gray-500 rounded-lg border bg-white px-5 py-2.5 text-gray-700 focus:outline-none focus:ring focus:ring-opacity-40 dark:bg-gray-900 dark:text-gray-300 {{if this.err "border-red-400 focus:border-red-400 focus:ring-red-300 dark:border-red-400 dark:focus:border-red-300" "border-gray-200 focus:border-blue-400 focus:ring-blue-300 dark:border-gray-600 dark:focus:border-blue-300"}} {{if @readonly "bg-gray-50 text-gray-600 border-gray-300"}}" readonly={{@readonly}}/>
    {{/if}}
    {{#if @err}}
    <p class="mt-3 text-xs text-red-400">请填写{{@key}}</p>
    {{/if}}

</div>